package com.iqik.filter.utils;


import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

@Component
public class RequestFilter implements Filter {

    @Override
    public void init(FilterConfig config) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("==========================================================filter============================================");
        RequestHolder.setting(request);
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        RequestHolder.remove();
    }

}
